<template>
  <router-link to="#">
    <img :src="goods.picture" alt="" />
    <p class="desc line-ellipsis">{{ goods.name }}</p>
    <small class="cate line-ellipsis">{{ goods.desc }}</small>
    <span class="price">&yen;{{ goods.price }}</span>
  </router-link>
</template>

<script setup lang="ts">
defineOptions({
  name: 'GoodsItem'
})
interface Props {
  goods: {
    id: string
    name: string
    desc: string
    price: string
    picture: string
    orderNum: number
  }
}
defineProps<Props>()
</script>

<style lang="scss" scoped>
a {
  display: flex;
  align-items: center;
  flex-direction: column;

  img {
    width: 160px;
    height: 160px;
    transition: transform 0.5s;

    &:hover {
      transform: scale(1.05);
    }
  }

  .desc {
    padding: 0 20px;
    margin-top: 12px;
    text-align: center;
  }

  .cate {
    margin: 12px 0 24px;
    color: #999;
    font-size: 14px;
    text-align: center;
  }

  .price {
    color: $price-color;
    font-size: 18px;
  }
}
</style>
